package com.yhyang.example.ribbonclient;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.http.ResponseEntity;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RestController;
import org.springframework.web.client.RestTemplate;

/**
 * @author <a href="mailto:yhy23456@163.com">huiyang.yu</a>
 * @since 2018.10.09
 */
@RestController
public class RibbonController {

    @Autowired
    private RestTemplate restTemplate;

    @GetMapping("/ribbon")
    public ResponseEntity<String> host() {
        ResponseEntity<String> responseEntity = restTemplate.getForEntity("http://SERVICE-PROVIDER/host", String.class);
        return responseEntity;
    }
}
